<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 求阶乘
        function jc(a) {
            var mul = 1;
            for (var i = 1 ; i <= a ; i++) {
                mul *= i;
            }
            // 输出阶乘
            return mul;
        }
        // 判断是否是喇叭花
        function LBflower(a) {
            // 拆分
            var ge = a % 10,
                shi = parseInt(a / 10) % 10,
                bai = parseInt(a / 100);
            var sum =jc(ge) + jc(shi) + jc(bai);
            // 判断阶乘和
            if (sum === a) {
                return true;
            } else {
                return false;
            }
        }
        // 输出三位数的喇叭花
        for (var i = 100 ; i <= 999 ; i++) {
            if (LBflower(i)) {
                console.log(i);
            }
        }
        
    </script>
</head>
<body>
    
</body>
</html>